<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: PDEHeadlessAutoBuild
  
    &mdash; Documentation by YARD 0.7.4
  
</title>

  <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '';
  if (relpath != '') relpath += '/';
</script>

  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>


  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html">Index (P)</a> &raquo; 
    
    
    <span class="title">PDEHeadlessAutoBuild</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a id="class_list_link" href="#">Class List</a>
  
    <a id="method_list_link" href="#">Method List</a>
  
    <a id="file_list_link" href="#">File List</a>
  
</div>
      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: PDEHeadlessAutoBuild
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">PDEHeadlessAutoBuild</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
  
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">pde_headless_autobuild.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>
PDE headless autobuild 类
</p>


  </div>
</div>
<div class="tags">
  
<h3>Author:</h3>
<ul class="author">
  
    <li>
      
      
      
      
        
        <div class='inline'><p>
许祯
</p>
</div>
      
    </li>
  
</ul>

</div>
  <h2>Constant Summary</h2>
  
    <dl class="constants">
      
        <dt id="Template_build_feature_command-classvariable" class="">@@Template_build_feature_command =
          
        </dt>
        <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>ant.bat -f ant_build_file.xml buildFeature -Dtimestamp=${timestamp} -Dbuildfeaturename=${feature_id} </span><span class='tstring_end'>&quot;</span></span></pre></dd>
      
        <dt id="Constants_MANIFEST_Name-classvariable" class="">@@Constants_MANIFEST_Name =
          
        </dt>
        <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>MANIFEST.MF</span><span class='tstring_end'>&quot;</span></span></pre></dd>
      
        <dt id="Template_tag_name-classvariable" class="">@@Template_tag_name =
          
        </dt>
        <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>BL_${Timestamp}_${BuildType}_${Alias}</span><span class='tstring_end'>&quot;</span></span></pre></dd>
      
        <dt id="Template_tag_message-classvariable" class="">@@Template_tag_message =
          
        </dt>
        <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>auto tag from ${src_url} to ${dest_url} </span><span class='tstring_end'>&quot;</span></span></pre></dd>
      
        <dt id="Template_tag_command-classvariable" class="">@@Template_tag_command =
          
        </dt>
        <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>svn copy ${src_url} -r ${revision} ${dest_url}  --message=\&quot;${message}\&quot; --username=\&quot;${username}\&quot; --password=\&quot;${password}\&quot;</span><span class='tstring_end'>&quot;</span></span></pre></dd>
      
        <dt id="Template_export_command-classvariable" class="">@@Template_export_command =
          
        </dt>
        <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>svn export ${tag_url}${target_dir}/${project_id} ${dest_path} --force</span><span class='tstring_end'>&quot;</span></span></pre></dd>
      
        <dt id="Template_dest_feature-classvariable" class="">@@Template_dest_feature =
          
        </dt>
        <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>${build_directory}${target_dir}/${feature_id}</span><span class='tstring_end'>&quot;</span></span></pre></dd>
      
        <dt id="URL_separate-classvariable" class="">@@URL_separate =
          
        </dt>
        <dd><pre class="code"><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>trunk</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>branches</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span></pre></dd>
      
    </dl>
  


  <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#m_build_directory-instance_method" title="#m_build_directory (instance method)">- (Object) <strong>m_build_directory</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute m_build_directory.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#m_build_info-instance_method" title="#m_build_info (instance method)">- (Object) <strong>m_build_info</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute m_build_info.
</p>
</div></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#m_tag_dest_urls-instance_method" title="#m_tag_dest_urls (instance method)">- (Object) <strong>m_tag_dest_urls</strong> </a>
    

    
  </span>
  
  
    
    
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
Returns the value of attribute m_tag_dest_urls.
</p>
</div></span>
  
</li>

    
  </ul>




  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#after_build-instance_method" title="#after_build (instance method)">- (Object) <strong>after_build</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
build完成后的工作.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#auto_tag-instance_method" title="#auto_tag (instance method)">- (Object) <strong>auto_tag</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
自动创建tag.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#backup_and_new_build_directory-instance_method" title="#backup_and_new_build_directory (instance method)">- (Object) <strong>backup_and_new_build_directory</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
将原始的buildDirectory目录重命名,并创建新的buildDirectory目录.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#before_build-instance_method" title="#before_build (instance method)">- (Object) <strong>before_build</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
build前的准备工作
</p>
<ul>
<li><p>
自动创建tag
</p>
</li>
<li><ul>
<li><p>
*.
</p>
</li>
</ul>
</li>
</ul>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#build_all-instance_method" title="#build_all (instance method)">- (Object) <strong>build_all</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
build所有feature.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#export_from_tag-instance_method" title="#export_from_tag (instance method)">- (Object) <strong>export_from_tag</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
从自动创建的tag中export代码.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#get_feature_require_plugins-instance_method" title="#get_feature_require_plugins (instance method)">- (Array) <strong>get_feature_require_plugins</strong>(feature_file) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
获取feature.xml文件中require的插件id.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#get_tag_url-instance_method" title="#get_tag_url (instance method)">- (String) <strong>get_tag_url</strong>(svn_info) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
生成tag的url.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (PDEHeadlessAutoBuild) <strong>initialize</strong>(build_info, build_directory) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
A new instance of PDEHeadlessAutoBuild.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#remove_readonly_attribute-instance_method" title="#remove_readonly_attribute (instance method)">- (Object) <strong>remove_readonly_attribute</strong> </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
调用系统命令，移除MANIFEST.MF文件的只读属性 pde headless
build的时候，需要往MANIFEST.MF中写文件，如果文件是readonly的将会报错.
</p>
</div></span>
  
</li>

      
    </ul>
  

<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="PDEHeadlessAutoBuild (class)">PDEHeadlessAutoBuild</a></span></tt>) <strong>initialize</strong>(build_info, build_directory) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A new instance of PDEHeadlessAutoBuild
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='name'>build_info</span>
      
      
        <span class='type'>(<tt><span class='object_link'><a href="PDEHeadlessUtil/PDEHeadlessBuildInfo.html" title="PDEHeadlessUtil::PDEHeadlessBuildInfo (class)">PDEHeadlessBuildInfo</a></span></tt>)</span>
      
      
      
    </li>
  
    <li>
      
        <span class='name'>build_directory</span>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
    </li>
  
</ul>


</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


14
15
16
17
18
19
20
21
22</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 14</span>

<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span> <span class='id identifier rubyid_build_info'>build_info</span><span class='comma'>,</span> <span class='id identifier rubyid_build_directory'>build_directory</span> <span class='rparen'>)</span>
	<span class='ivar'>@m_build_info</span> <span class='op'>=</span> <span class='id identifier rubyid_build_info'>build_info</span>
	<span class='ivar'>@m_build_directory</span> <span class='op'>=</span> <span class='id identifier rubyid_build_directory'>build_directory</span>
	<span class='comment'>## map = { svn-info =&gt; tag_dest_url }
</span>	<span class='ivar'>@m_tag_dest_urls</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
	<span class='ivar'>@m_username</span> <span class='op'>=</span> <span class='ivar'>@m_build_info</span><span class='period'>.</span><span class='id identifier rubyid_m_global_setting'>m_global_setting</span><span class='period'>.</span><span class='id identifier rubyid_m_username'>m_username</span>
	<span class='ivar'>@m_password</span> <span class='op'>=</span> <span class='ivar'>@m_build_info</span><span class='period'>.</span><span class='id identifier rubyid_m_global_setting'>m_global_setting</span><span class='period'>.</span><span class='id identifier rubyid_m_password'>m_password</span>
	<span class='ivar'>@m_build_timestamp</span> <span class='op'>=</span> <span class='ivar'>@m_build_info</span><span class='period'>.</span><span class='id identifier rubyid_m_global_setting'>m_global_setting</span><span class='period'>.</span><span class='id identifier rubyid_m_build_timestamp'>m_build_timestamp</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
  
</div>

  <div id="instance_attr_details" class="attr_details">
    <h2>Instance Attribute Details</h2>
    
      
      <span id="m_build_directory=-instance_method"></span>
      <span id="m_build_directory-instance_method"></span>
      <div class="method_details first">
  <p class="signature first" id="m_build_directory-instance_method">
  
    - (<tt>Object</tt>) <strong>m_build_directory</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute m_build_directory
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 10</span>

<span class='kw'>def</span> <span class='id identifier rubyid_m_build_directory'>m_build_directory</span>
  <span class='ivar'>@m_build_directory</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="m_build_info=-instance_method"></span>
      <span id="m_build_info-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="m_build_info-instance_method">
  
    - (<tt>Object</tt>) <strong>m_build_info</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute m_build_info
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 10</span>

<span class='kw'>def</span> <span class='id identifier rubyid_m_build_info'>m_build_info</span>
  <span class='ivar'>@m_build_info</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      
      <span id="m_tag_dest_urls=-instance_method"></span>
      <span id="m_tag_dest_urls-instance_method"></span>
      <div class="method_details ">
  <p class="signature " id="m_tag_dest_urls-instance_method">
  
    - (<tt>Object</tt>) <strong>m_tag_dest_urls</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
Returns the value of attribute m_tag_dest_urls
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


10
11
12</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 10</span>

<span class='kw'>def</span> <span class='id identifier rubyid_m_tag_dest_urls'>m_tag_dest_urls</span>
  <span class='ivar'>@m_tag_dest_urls</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="after_build-instance_method">
  
    - (<tt>Object</tt>) <strong>after_build</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
build完成后的工作
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


37
38
39</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 37</span>

<span class='kw'>def</span> <span class='id identifier rubyid_after_build'>after_build</span>

<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="auto_tag-instance_method">
  
    - (<tt>Object</tt>) <strong>auto_tag</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
自动创建tag
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 96</span>

<span class='kw'>def</span> <span class='id identifier rubyid_auto_tag'>auto_tag</span>
	<span class='id identifier rubyid_commands'>commands</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
	<span class='ivar'>@m_build_info</span><span class='period'>.</span><span class='id identifier rubyid_m_svn_infoes'>m_svn_infoes</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_info'>info</span><span class='op'>|</span>	
		<span class='id identifier rubyid_base_url'>base_url</span> <span class='op'>=</span> <span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_m_url'>m_url</span>
		<span class='id identifier rubyid_dest_url'>dest_url</span> <span class='op'>=</span> <span class='id identifier rubyid_get_tag_url'>get_tag_url</span><span class='lparen'>(</span><span class='id identifier rubyid_info'>info</span><span class='rparen'>)</span>

		<span class='id identifier rubyid_tag_message'>tag_message</span> <span class='op'>=</span> <span class='cvar'>@@Template_tag_message</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${src_url}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_base_url'>base_url</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${dest_url}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_dest_url'>dest_url</span><span class='rparen'>)</span>

		<span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='cvar'>@@Template_tag_command</span><span class='period'>
</span><span class='id identifier rubyid_					.gsub'>					.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${src_url}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_base_url'>base_url</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_					.gsub'>					.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${dest_url}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_dest_url'>dest_url</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_					.gsub'>					.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${revision}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_m_revision'>m_revision</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_					.gsub'>					.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${message}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_tag_message'>tag_message</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_					.gsub'>					.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${username}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='ivar'>@m_username</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_					.gsub'>					.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${password}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='ivar'>@m_password</span><span class='rparen'>)</span>
		<span class='id identifier rubyid_commands'>commands</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_command'>command</span>
		<span class='ivar'>@m_tag_dest_urls</span><span class='lbracket'>[</span><span class='id identifier rubyid_base_url'>base_url</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_dest_url'>dest_url</span>
	<span class='kw'>end</span>
	<span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_execute_commands'>execute_commands</span><span class='lparen'>(</span> <span class='id identifier rubyid_commands'>commands</span> <span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="backup_and_new_build_directory-instance_method">
  
    - (<tt>Object</tt>) <strong>backup_and_new_build_directory</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
将原始的buildDirectory目录重命名,并创建新的buildDirectory目录
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


85
86
87
88
89</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 85</span>

<span class='kw'>def</span> <span class='id identifier rubyid_backup_and_new_build_directory'>backup_and_new_build_directory</span> 
	<span class='comment'>#FileUtils.rm_rf @m_build_directory
</span>	<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_mv'>mv</span> <span class='ivar'>@m_build_directory</span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='ivar'>@m_build_directory</span><span class='rbrace'>}</span><span class='tstring_content'>_before_</span><span class='embexpr_beg'>#{</span><span class='ivar'>@m_build_timestamp</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
	<span class='const'>FileUtils</span><span class='period'>.</span><span class='id identifier rubyid_mkdir'>mkdir</span> <span class='ivar'>@m_build_directory</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="before_build-instance_method">
  
    - (<tt>Object</tt>) <strong>before_build</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
build前的准备工作
</p>
<ul>
<li><p>
自动创建tag
</p>
</li>
<li><ul>
<li><p>
*
</p>
</li>
</ul>
</li>
</ul>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


29
30
31
32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 29</span>

<span class='kw'>def</span> <span class='id identifier rubyid_before_build'>before_build</span>
	<span class='id identifier rubyid_auto_tag'>auto_tag</span>
	<span class='id identifier rubyid_backup_and_new_build_directory'>backup_and_new_build_directory</span>
	<span class='id identifier rubyid_export_from_tag'>export_from_tag</span>
	<span class='id identifier rubyid_remove_readonly_attribute'>remove_readonly_attribute</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="build_all-instance_method">
  
    - (<tt>Object</tt>) <strong>build_all</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
build所有feature
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


44
45
46
47
48
49
50
51
52
53
54
55
56</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 44</span>

<span class='kw'>def</span> <span class='id identifier rubyid_build_all'>build_all</span>
	<span class='id identifier rubyid_commands'>commands</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
	<span class='ivar'>@m_build_info</span><span class='period'>.</span><span class='id identifier rubyid_m_svn_infoes'>m_svn_infoes</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_svn_info'>svn_info</span><span class='op'>|</span>
		<span class='id identifier rubyid_svn_info'>svn_info</span><span class='period'>.</span><span class='id identifier rubyid_m_feature_IDs'>m_feature_IDs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_feature_id'>feature_id</span><span class='op'>|</span>	
			<span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='cvar'>@@Template_build_feature_command</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${timestamp}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='ivar'>@m_build_timestamp</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${feature_id}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_feature_id'>feature_id</span><span class='rparen'>)</span>
			<span class='id identifier rubyid_commands'>commands</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_command'>command</span>
		<span class='kw'>end</span>
	<span class='kw'>end</span>

	<span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_execute_commands'>execute_commands</span><span class='lparen'>(</span><span class='id identifier rubyid_commands'>commands</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="export_from_tag-instance_method">
  
    - (<tt>Object</tt>) <strong>export_from_tag</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
从自动创建的tag中export代码
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 123</span>

<span class='kw'>def</span> <span class='id identifier rubyid_export_from_tag'>export_from_tag</span> 
	<span class='ivar'>@m_build_info</span><span class='period'>.</span><span class='id identifier rubyid_m_svn_infoes'>m_svn_infoes</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_info'>info</span><span class='op'>|</span>	
		<span class='id identifier rubyid_dir_features'>dir_features</span> <span class='op'>=</span> <span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_m_dir_features'>m_dir_features</span>
		<span class='id identifier rubyid_dir_plugins'>dir_plugins</span> <span class='op'>=</span> <span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_m_dir_plugins'>m_dir_plugins</span>

		<span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_m_feature_IDs'>m_feature_IDs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_feature_id'>feature_id</span><span class='op'>|</span>
			<span class='id identifier rubyid_dest_feature'>dest_feature</span> <span class='op'>=</span> <span class='cvar'>@@Template_dest_feature</span><span class='period'>
</span><span class='id identifier rubyid_							.gsub'>							.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${build_directory}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_correct_path'>correct_path</span><span class='lparen'>(</span> <span class='ivar'>@m_build_directory</span> <span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_							.gsub'>							.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${target_dir}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>features</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_							.gsub'>							.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${feature_id}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_feature_id'>feature_id</span><span class='rparen'>)</span>


			<span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='cvar'>@@Template_export_command</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${tag_url}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_correct_path'>correct_path</span><span class='lparen'>(</span><span class='ivar'>@m_tag_dest_urls</span><span class='lbracket'>[</span><span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_m_url'>m_url</span><span class='rbracket'>]</span> <span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${target_dir}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_dir_features'>dir_features</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${project_id}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_feature_id'>feature_id</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${dest_path}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_dest_feature'>dest_feature</span><span class='rparen'>)</span>
			
			<span class='comment'># export feature
</span>			<span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_execute_command'>execute_command</span><span class='lparen'>(</span> <span class='id identifier rubyid_command'>command</span> <span class='rparen'>)</span>

			<span class='comment'># get all plugins required by the feature
</span>			<span class='id identifier rubyid_feature_file'>feature_file</span> <span class='op'>=</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_dest_feature'>dest_feature</span><span class='rbrace'>}</span><span class='tstring_content'>/feature.xml</span><span class='tstring_end'>&quot;</span></span> <span class='rparen'>)</span>	

			<span class='id identifier rubyid_required_plugins'>required_plugins</span> <span class='op'>=</span> <span class='id identifier rubyid_get_feature_require_plugins'>get_feature_require_plugins</span><span class='lparen'>(</span> <span class='id identifier rubyid_feature_file'>feature_file</span> <span class='rparen'>)</span>
			
			<span class='id identifier rubyid_commands'>commands</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
			<span class='id identifier rubyid_required_plugins'>required_plugins</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_plugin'>plugin</span><span class='op'>|</span>
				<span class='id identifier rubyid_dest_plugin'>dest_plugin</span> <span class='op'>=</span> <span class='cvar'>@@Template_dest_feature</span><span class='period'>
</span><span class='id identifier rubyid_							.gsub'>							.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${build_directory}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_correct_path'>correct_path</span><span class='lparen'>(</span> <span class='ivar'>@m_build_directory</span> <span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_							.gsub'>							.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${target_dir}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>plugins</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_							.gsub'>							.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${feature_id}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_plugin'>plugin</span><span class='rparen'>)</span>

				<span class='id identifier rubyid_command'>command</span> <span class='op'>=</span> <span class='cvar'>@@Template_export_command</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${tag_url}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_correct_path'>correct_path</span><span class='lparen'>(</span><span class='ivar'>@m_tag_dest_urls</span><span class='lbracket'>[</span><span class='id identifier rubyid_info'>info</span><span class='period'>.</span><span class='id identifier rubyid_m_url'>m_url</span><span class='rbracket'>]</span> <span class='rparen'>)</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${target_dir}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='id identifier rubyid_dir_plugins'>dir_plugins</span> <span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${project_id}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_plugin'>plugin</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_						.gsub'>						.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${dest_path}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span><span class='id identifier rubyid_dest_plugin'>dest_plugin</span> <span class='rparen'>)</span>
				
				<span class='id identifier rubyid_commands'>commands</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_command'>command</span>
			<span class='kw'>end</span>
			<span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_execute_commands'>execute_commands</span><span class='lparen'>(</span> <span class='id identifier rubyid_commands'>commands</span> <span class='rparen'>)</span>
		<span class='kw'>end</span>
	<span class='kw'>end</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="get_feature_require_plugins-instance_method">
  
    - (<tt>Array</tt>) <strong>get_feature_require_plugins</strong>(feature_file) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
获取feature.xml文件中require的插件id
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='name'>feature_file</span>
      
      
        <span class='type'>(<tt>File</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>
需要获取的feature.xml
</p>
</div>
      
    </li>
  
</ul>

<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>Array</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>
result_plugin_ids，该feature_file包含的插件信息
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


172
173
174
175
176
177
178
179
180
181
182
183
184
185</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 172</span>

<span class='kw'>def</span> <span class='id identifier rubyid_get_feature_require_plugins'>get_feature_require_plugins</span><span class='lparen'>(</span> <span class='id identifier rubyid_feature_file'>feature_file</span> <span class='rparen'>)</span>
	<span class='id identifier rubyid_build_directory'>build_directory</span> <span class='op'>=</span> <span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_correct_path'>correct_path</span> <span class='lparen'>(</span> <span class='ivar'>@m_build_directory</span> <span class='rparen'>)</span> 
	<span class='id identifier rubyid_result_plugin_ids'>result_plugin_ids</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
	<span class='kw'>begin</span>	
		<span class='id identifier rubyid_feature_doc'>feature_doc</span> <span class='op'>=</span> <span class='const'>Document</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_feature_file'>feature_file</span><span class='rparen'>)</span>
		<span class='id identifier rubyid_feature_doc'>feature_doc</span><span class='period'>.</span><span class='id identifier rubyid_elements'>elements</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>feature/plugin</span><span class='tstring_end'>&quot;</span></span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_element'>element</span><span class='op'>|</span>
			<span class='id identifier rubyid_plugin_id'>plugin_id</span> <span class='op'>=</span> <span class='id identifier rubyid_element'>element</span><span class='period'>.</span><span class='id identifier rubyid_attributes'>attributes</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>id</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span>
			<span class='id identifier rubyid_result_plugin_ids'>result_plugin_ids</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_plugin_id'>plugin_id</span>
		<span class='kw'>end</span>
	<span class='kw'>rescue</span> <span class='const'>Exception</span> <span class='op'>=&gt;</span> <span class='id identifier rubyid_e'>e</span>
		<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_e'>e</span>
	<span class='kw'>end</span>
	<span class='kw'>return</span> <span class='id identifier rubyid_result_plugin_ids'>result_plugin_ids</span> 
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="get_tag_url-instance_method">
  
    - (<tt>String</tt>) <strong>get_tag_url</strong>(svn_info) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
生成tag的url
</p>


  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='name'>svninfo</span>
      
      
        <span class='type'>(<tt>PDEHeadlessBuildInfo::SVNInfo</tt>)</span>
      
      
      
    </li>
  
</ul>

<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
      
        &mdash;
        <div class='inline'><p>
svninfo的tag url
</p>
</div>
      
    </li>
  
</ul>
<h3>Raises:</h3>
<ul class="raise">
  
    <li>
      
      
        <span class='type'></span>
      
      
      
        
        <div class='inline'><p>
url地址必须包含&#8220;trunk&#8221;或者&#8220;branches&#8221;,如果没有包含，生成tag_url失败
</p>
</div>
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 194</span>

<span class='kw'>def</span> <span class='id identifier rubyid_get_tag_url'>get_tag_url</span><span class='lparen'>(</span> <span class='id identifier rubyid_svn_info'>svn_info</span> <span class='rparen'>)</span>
	<span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='id identifier rubyid_svn_info'>svn_info</span><span class='period'>.</span><span class='id identifier rubyid_m_url'>m_url</span>

	<span class='id identifier rubyid_tag_name'>tag_name</span> <span class='op'>=</span> <span class='cvar'>@@Template_tag_name</span><span class='period'>
</span><span class='id identifier rubyid_		.gsub'>		.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${Timestamp}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='ivar'>@m_build_timestamp</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_		.gsub'>		.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${BuildType}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='id identifier rubyid_svn_info'>svn_info</span><span class='period'>.</span><span class='id identifier rubyid_m_build_type'>m_build_type</span><span class='rparen'>)</span><span class='period'>
</span><span class='id identifier rubyid_		.gsub'>		.gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>\${Alias}</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='id identifier rubyid_svn_info'>svn_info</span><span class='period'>.</span><span class='id identifier rubyid_m_url_alias'>m_url_alias</span><span class='rparen'>)</span>

	<span class='id identifier rubyid_seprate_index'>seprate_index</span> <span class='op'>=</span> <span class='kw'>nil</span>
	<span class='cvar'>@@URL_separate</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_seprate'>seprate</span><span class='op'>|</span>
		<span class='kw'>if</span> <span class='id identifier rubyid_url'>url</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_seprate'>seprate</span><span class='rparen'>)</span> <span class='op'>!=</span> <span class='kw'>nil</span>
			<span class='id identifier rubyid_seprate_index'>seprate_index</span> <span class='op'>=</span> <span class='id identifier rubyid_url'>url</span><span class='period'>.</span><span class='id identifier rubyid_index'>index</span><span class='lparen'>(</span><span class='id identifier rubyid_seprate'>seprate</span><span class='rparen'>)</span>
			<span class='kw'>break</span>
		<span class='kw'>end</span>
	<span class='kw'>end</span>
	<span class='id identifier rubyid_raise'>raise</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>URL must contains one of </span><span class='embexpr_beg'>#{</span><span class='cvar'>@@URL_separate</span><span class='rbrace'>}</span><span class='tstring_content'> </span><span class='tstring_end'>&quot;</span></span> <span class='kw'>if</span> <span class='id identifier rubyid_seprate_index'>seprate_index</span> <span class='op'>==</span> <span class='kw'>nil</span>
	<span class='id identifier rubyid_result_tag_url'>result_tag_url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_url'>url</span><span class='lbracket'>[</span><span class='int'>0</span><span class='comma'>,</span><span class='id identifier rubyid_seprate_index'>seprate_index</span><span class='rbracket'>]</span><span class='rbrace'>}</span><span class='tstring_content'>tags/</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_tag_name'>tag_name</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>

	<span class='kw'>return</span> <span class='id identifier rubyid_result_tag_url'>result_tag_url</span>
<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="remove_readonly_attribute-instance_method">
  
    - (<tt>Object</tt>) <strong>remove_readonly_attribute</strong> 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
调用系统命令，移除MANIFEST.MF文件的只读属性 pde headless
build的时候，需要往MANIFEST.MF中写文件，如果文件是readonly的将会报错
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'pde_headless_autobuild.rb', line 62</span>

<span class='kw'>def</span> <span class='id identifier rubyid_remove_readonly_attribute'>remove_readonly_attribute</span>
	<span class='id identifier rubyid_manifest_file_list'>manifest_file_list</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>	
	<span class='const'>Find</span><span class='period'>.</span><span class='id identifier rubyid_find'>find</span><span class='lparen'>(</span><span class='ivar'>@m_build_directory</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_path'>path</span><span class='op'>|</span>
		<span class='const'>Find</span><span class='period'>.</span><span class='id identifier rubyid_prune'>prune</span> <span class='kw'>if</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>.</span><span class='tstring_end'>&quot;</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>..</span><span class='tstring_end'>&quot;</span></span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_path'>path</span>
		<span class='kw'>case</span> <span class='cvar'>@@Constants_MANIFEST_Name</span>
		<span class='kw'>when</span> <span class='const'>String</span>
			<span class='id identifier rubyid_manifest_file_list'>manifest_file_list</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_path'>path</span> <span class='kw'>if</span> <span class='const'>File</span><span class='period'>.</span><span class='id identifier rubyid_basename'>basename</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='cvar'>@@Constants_MANIFEST_Name</span>
		<span class='kw'>else</span>
			<span class='id identifier rubyid_raise'>raise</span> <span class='const'>ArgumentError</span>
		<span class='kw'>end</span>
	<span class='kw'>end</span>
	
	<span class='id identifier rubyid_commands'>commands</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
	<span class='id identifier rubyid_manifest_file_list'>manifest_file_list</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_filepath'>filepath</span><span class='op'>|</span>
		<span class='comment'>## FIXME only Windows works
</span>		<span class='id identifier rubyid_commands'>commands</span> <span class='op'>&lt;&lt;</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>attrib -R </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_filepath'>filepath</span><span class='rbrace'>}</span><span class='tstring_end'>&quot;</span></span>
	<span class='kw'>end</span>
	
	<span class='const'>PDEHeadlessUtil</span><span class='period'>.</span><span class='id identifier rubyid_execute_commands'>execute_commands</span><span class='lparen'>(</span> <span class='id identifier rubyid_commands'>commands</span> <span class='rparen'>)</span>

<span class='kw'>end</span></pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Mon Jan 30 13:37:15 2012 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.7.4 (ruby-1.9.2).
</div>

  </body>
</html>